package com.mc.algorithm;

public class MaxCommonMeasure {
	
	public static int max(int a,int b){
		while(a!=b)
		{
			if(a>b)
				a-=b;
			else
				b-=a;
		}
		return a;
	}
	//欧几里得 
	public static int max2(int a,int b){
		if(a%b==0){
			return b;
		}
		else
			return max2(b,a%b);
	}
	//欧几里得
	public static int max3(int a,int b){
		int c;
		while((c=(a%b))!=0){
			a = b;
			b = c;
		}
		return b;
	}
	public static void main(String[] args) {
		int res =MaxCommonMeasure.max2(144,30);
		System.out.println(res);
	}
}
